<html>
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>Document</title>
	<script type="text/javascript">
		function startTime(){
			var today=new Date()
			var h=today.getHours()
			var m=today.getMinutes()
			var s=today.getSeconds()
			m=checkTime(m)
			s=checkTime(s)
			document.getElementById('txt').innerHTML=h+":"+m+":"+s
			t=setTimeout('startTime()',500)
		}

		function checkTime(i)
		{
			if(i<10){
				i="0" + i
			}
			return i
		}
	</script>
</head>
<body onload="startTime()">
	<div id="txt"></div>
	
	<script type="text/javascript">
		function person(firstname,lastname,age,eyecolor){
			this.firstname=firstname;
			this.lastname=lastname;
			this.age=age;
			this.eyecolor=eyecolor;

		    this.changeName=changeName;
		    function changeName(name){
			    this.lastname=name;
		    }
		}

		myMother=new person("Steve","Jobs",56,"green");
		myMother.changeName("Ballmer");
		document.write(myMother.lastname+"<br>");

		var txt="Hello World!"
		document.write(txt.length+"<br>")
		document.write("<p>Big：" + txt.big() + "</p>")

		var str="Hello world!"
		document.write(str.indexOf("world")+"<br>")
		document.write(str.match("world!")+"<br>")

		var rep="Visit Microsoft!"
		document.write(rep.replace(/Microsoft/,"w3cSchool")+"<br>")

		document.write(Date() + "<br>")

		var d=new Date();
		d.setFullYear(1992,10,3)
		document.write(d)

		document.write("<br>")

		var patt1=new RegExp("e");

		document.write(patt1.test("The best things in life are free"));
		patt1.compile("d");
		document.write(patt1.test("The best things in life are free"))

		document.write("<br>")

		document.write(patt1.exec("The best things in life are free"));

        var patt2=new RegExp("e","g");
		do{
			result=patt2.exec("The best things in life are free");
			document.write(result);
		}
		while(result!=null) 


	</script>
</body>
</html>